{% extends base %}

{% block head %}
    <script type="text/javascript" src="/static/lib/csv.js/csv.js"></script>
    <script type="text/javascript" src="/static/lib/marked/marked.js"></script>
    <script type="text/javascript" src="/static/js/marked-ext.js"></script>

    {% include note/component/view_css.html %}

{% end %}

{% block body_top %}
    <div class="card">
        {% include note/component/view_group_header.html %}
    </div>
{% end %}

{% block body_left %}
    {% init file_type       = "md" %}
    {% init pathlist        = [] %}
    {% init file            = None %}
    {% init show_notice     = False %}
    {% init show_search_div = True %}
    {% init show_add_file   = False %}
    {% init show_add_group  = False %}
    {% init show_path_list  = True %}
    {% init show_pagination = False %}
    {% init show_comment    = True %}
    {% init error           = "" %}
    {% init show_ext_info   = True %}

    <div class="mobile-only">
        {% include note/component/note_orderby_select.html %}
    </div>

    {% include note/editor/view_group.html %}

    {# 文章信息 #}
    {% if show_ext_info %}
        <div class="card">
            <div class="pad5">{{file.creator}} 创建于 {{file.cdate}} 更新于 {{file.mdate}}</div>
        </div>
    {% end %}

    {# 分页 #}
    {% if show_pagination and "page" in globals() %}
        <div class="card">
            {% include mod_pagenation.html %}
        </div>
    {% end %}
{% end %}

{% block body_right %}
<div class="desktop-only">

    <div class="card group-option-card">
        <div class="card">
            <span class="btn-line-height">状态</span>
            <div class="float-right">
                <select class="status-select" data-id="{{file.id}}" value="{{file.priority}}">
                    <option value="1">置顶</option>
                    <option value="0">活跃</option>
                    <option value="-1">归档</option>
                </select>
            </div>
        </div>

        {% include note/component/note_orderby_select.html %}

        <div class="pad5 group-detail-btn-box">
            <a class="btn btn-default note-share-btn" data-id="{{file.id}}">分享</a>
        </div>
    </div>

    {% import markdown %}

    <div class="card">
        <div class="card-title">
            <span>简介</span>
            <div class="float-right">
                <a href="/note/edit?id={{file.id}}">编辑</a>
            </div>
        </div>
        {% if file.content == None or file.content == "" %}
            <p class="align-center">暂无简介</p>
        {% else %}
            {% try %}
                <div class="pad5 markdown-box">{% raw markdown.markdown(file.content) %}</div>
            {% except %}
                <div class="pad5 markdown-box">抱歉,markdown解析出错!</div>
            {% end %}
        {% end %}
    </div>

</div>
{% end %}

{% block aside %}
    {% include note/component/mod_aside.html %}
{% end %}
